#include "stdafx.h"
#include "IMultInterface.h"
#include "MyClassFactory.h"

BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
	switch (dwReason)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;
}

HRESULT STDAPICALLTYPE DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
{
    if (!IsEqualCLSID(rclsid, CLSID_IMultInterface))
    {
        *ppv = 0;
        return CLASS_E_CLASSNOTAVAILABLE;
    }
    return ClassFactory.QueryInterface(riid, ppv);
}

HRESULT STDAPICALLTYPE DllCanUnloadNow()
{
    return OutstandingObjects || LockCount ? S_FALSE : S_OK;
}